package com.lzx.iteam.bean;

import com.lzx.iteam.util.StringUtil;

import java.io.Serializable;

import static android.R.attr.data;

/**
 * Created with IntelliJ IDEA.
 * **********************************
 * User: zhangshuai
 * Date: 2017年 01月 16日
 * Time: 下午12:11
 *
 * @QQ : 1234567890
 * **********************************
 */
public class SalaryAttendanceBean implements Serializable {

    private String _id;
    private String user_id;
    private String user_name;
    private float total;                // 工作日
    private float work_day;             // 在岗天数
    private float approval_business;    // 出差天数
    private float approval_leave;       // 非带薪请假天数
    private float paid_holidays;        // 带薪假期
    private float approval_out;         // 外出天数
    private float work_leave_early_count; // 早退次数
    private float work_be_late_count;     // 迟到次数
    private float un_work;                // 旷工天数
    private float over_time;              // 加班天数


    public String get_id() {
        return _id;
    }

    public void set_id(String _id) {
        this._id = _id;
    }

    public String getUser_id() {
        return user_id;
    }

    public void setUser_id(String user_id) {
        this.user_id = user_id;
    }

    public String getUser_name() {
        return user_name;
    }

    public void setUser_name(String user_name) {
        this.user_name = user_name;
    }


    public float getTotal() {
        return total;
    }

    public void setTotal(float total) {
        this.total = total;
    }

    public float getWork_day() {
        return work_day;
    }

    public void setWork_day(float work_day) {
        this.work_day = work_day;
    }

    public float getApproval_business() {
        return approval_business;
    }

    public void setApproval_business(float approval_business) {
        this.approval_business = approval_business;
    }

    public float getApproval_leave() {
        return approval_leave;
    }

    public void setApproval_leave(float approval_leave) {
        this.approval_leave = approval_leave;
    }

    public float getPaid_holidays() {
        return paid_holidays;
    }

    public void setPaid_holidays(float paid_holidays) {
        this.paid_holidays = paid_holidays;
    }

    public float getApproval_out() {
        return approval_out;
    }

    public void setApproval_out(float approval_out) {
        this.approval_out = approval_out;
    }

    public float getWork_leave_early_count() {
        return work_leave_early_count;
    }

    public void setWork_leave_early_count(float work_leave_early_count) {
        this.work_leave_early_count = work_leave_early_count;
    }

    public float getWork_be_late_count() {
        return work_be_late_count;
    }

    public void setWork_be_late_count(float work_be_late_count) {
        this.work_be_late_count = work_be_late_count;
    }

    public float getUn_work() {
        return un_work;
    }

    public void setUn_work(float un_work) {
        this.un_work = un_work;
    }

    public float getOver_time() {
        return over_time;
    }

    public void setOver_time(float over_time) {
        this.over_time = over_time;
    }

    public void setData(int position , String data){

        float num = 0;
        if (!StringUtil.isEmpty(data)){
            num = Float.parseFloat(data);
        }

        switch (position){
            case 0:
                setTotal(num);
                break;
            case 1:
                setWork_day(num);
                break;
            case 2:
                setApproval_business(num);
                break;
            case 3:
                setPaid_holidays(num);
                break;
            case 4:
                setApproval_leave(num);
                break;
            case 5:
                setApproval_out(num);
                break;
            case 6:
                setWork_leave_early_count(num);
                break;
            case 7:
                setWork_be_late_count(num);
                break;
            case 8:
                setUn_work(num);
                break;
            case 9:
                setOver_time(num);
                break;
        }

    }

    @Override
    public String toString() {
        return "SalaryAttendanceBean{" +
              "user_id='" + user_id + '\'' +
              ", user_name='" + user_name + '\'' +
              ", total=" + total +
              ", work_day=" + work_day +
              ", approval_business=" + approval_business +
              ", approval_leave=" + approval_leave +
              ", paid_holidays=" + paid_holidays +
              ", approval_out=" + approval_out +
              ", work_leave_early_count=" + work_leave_early_count +
              ", work_be_late_count=" + work_be_late_count +
              ", un_work=" + un_work +
              '}';
    }
}
